let
  btrfs.mountOptions = [ "compress=zstd" ];
in {
  disko.devices = {
    disk = {
      main = {
        device = "/dev/disk/by-id/nvme-SAMSUNG_MZAL4256HBJD-00BL2_S67PNE0W629245";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              size = "1G";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
              };
            };
            luks-swap = {
              size = "12G";
              content = {
                type = "luks";
                name = "crypted-swap";
                settings.allowDiscards = true;
                content = {
                  type = "swap";
                  discardPolicy = "both";
                };
              };
            };
            luks-system = {
              size = "100%";
              content = {
                type = "luks";
                name = "crypted-system";
                settings.allowDiscards = true;
                content = {
                  type = "btrfs";
                  mountpoint = "/system";
                  inherit (btrfs) mountOptions;
                  subvolumes = {
                    "/home" = {
                      inherit (btrfs) mountOptions;
                      mountpoint = "/home";
                    };
                    "/nix" = {
                      inherit (btrfs) mountOptions;
                      mountpoint = "/nix";
                    };
                    "/persist" = {};
                  };
                };
              };
            };
          };
        };
      };
    };
    nodev."/" = {
      fsType = "tmpfs";
      mountOptions = [ "size=256M" "mode=755" ];
    };
  };
}
